import java.util.Scanner;


public class Cript04_06 {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		System.out.println("Please enter your sentance:");
		String s = sc.nextLine();
		String sOdd="";
		String sEven="";
		String cripted = "";
		String decripted="";
		while(s.length()<=0){
			System.out.println("Please enter your sentance:");
			 s = sc.nextLine();
		}
		 
		for (int i = 0; i<s.length(); i++){
			if(i%2==0){
				sEven+=s.charAt(i);
			}
			else{
				sOdd+=s.charAt(i);
			}
		}
//		System.out.println(sEven);
//		System.out.println(sOdd);
		cripted = sEven+sOdd;
		System.out.println("Crypted word is : "+cripted);
		sEven="";
		sOdd="";
		
		if(cripted.length()%2==0){
			sEven+=cripted.substring(0, cripted.length()/2);
			sOdd+=cripted.substring(s.length()/2, cripted.length());
		}
		else{
			sEven+=cripted.substring(0, (cripted.length()/2+1));
			sOdd+=cripted.substring((cripted.length()/2+1), cripted.length());
		}
		
	//	System.out.println(sEven);
	//	System.out.println(sOdd);
		int n=0;
		int m=0;
		for (int i = 0; i<s.length(); i++){
			if(i%2==0){
				decripted+=sEven.charAt(n);
				n++;
			}
			else{
				
				decripted+=sOdd.charAt(m);
				m++;
			}
		}
		System.out.println("Decripted word is : " + decripted);

	}

}
